# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/gnome <pabloyoyoista@postmarketos.org>
pkgname=calls
pkgver=47.0
pkgrel=0
pkgdesc="Phone dialer and call handler"
# armhf and s390x blocked by libpeas2 -> gjs-dev -> mozjs
arch="all !armhf !s390x"
url="https://gitlab.gnome.org/GNOME/calls"
license="GPL-3.0-or-later"
depends="
	callaudiod
	modemmanager
	sofia-sip-linphone
	"
makedepends="
	callaudiod-dev
	desktop-file-utils
	evolution-data-server-dev
	feedbackd-dev
	folks-dev
	gettext-dev
	gobject-introspection-dev
	gom-dev
	gsound-dev
	gstreamer-dev
	gtk4.0-dev
	libadwaita-dev
	libpeas2-dev
	meson
	modemmanager-dev
	ninja
	py3-docutils
	sofia-sip-linphone-dev
	vala
	"
subpackages="$pkgname-doc $pkgname-dbg $pkgname-lang"
source="https://download.gnome.org/sources/calls/${pkgver%%.*}/calls-$pkgver.tar.xz
	"
options="!check" # Requires running Wayland compositor

build() {
	abuild-meson \
		-Db_lto=true \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	# We don't ship systemd
	rm -r "$pkgdir"/usr/lib/systemd
}

sha512sums="
422f76b11de100ba347ef352bc13d1343a442fccf46331e605c496ee000691e5f6500503cbfbaffff8aa308a9a15d84334b457a891bc039dff28e413308bad65  calls-47.0.tar.xz
"
